import request from "../request.js"
import {
	BASE_URL,
	LOGIN,
	GET_USERINFO,
	AUTH,
	GET_COLLECT,
	COLLECT,
	MY_LIKE,
	RECORD,
	GET_RECORD
} from "../const.js"

const profile = {
	login(data) {
		return request({
			url: BASE_URL + LOGIN,
			method: 'POST',
			data
		})
	},
	getUserInfo(token) {
		return request({
			url: BASE_URL + GET_USERINFO,
			header: {
				Authorization: token
			},
			data: {
				token
			}
		})
	},
	auth(token,userInfo) {
		return request({
			url: BASE_URL + AUTH,
			header: {
				Authorization: token
			},
			method: 'POST',
			data: {
				token,
				...userInfo
			}
		})
	},
	getcollect(token,data) {
		return request({
			url: BASE_URL + GET_COLLECT,
			header: {
				Authorization: token
			},
			data
		})
	},
	collect(token,data) {
		return request({
			url: BASE_URL + COLLECT,
			header: {
				Authorization: token
			},
			method: 'POST',
			data
		})
	},
	mylike(token,data) {
		return request({
			url: BASE_URL + MY_LIKE,
			header: {
				Authorization: token
			},
			data
		})
	},
	record(token,data) {
		return request({
			url: BASE_URL + RECORD,
			header: {
				Authorization: token
			},
			data
		})
	},
	getrecord(token,data) {
		return request({
			url: BASE_URL + GET_RECORD,
			header: {
				Authorization: token
			},
			data
		})
	}
	
}

export default profile;
